<?php

class DefaultController extends Controller
{
    /**
     * @var string the default layout for the views. Defaults to '//layouts/column2', meaning
     * using two-column layout. See 'protected/views/layouts/column2.php'.
     */
    public $layout = '//layouts/customer';

    /**
     * @return array action filters
     */
    public function filters() {
        return array(
            'accessControl', // perform access control for CRUD operations
            array(
                'application.filters.RequireLoginFilter',
            ),
        );
    }
	public function actionIndex()
	{
		$this->redirect('index.php?r=customerportal/Customers/update');
	}
    public function actionUpdatePassword()
    {
        $success = false;
        $model = Users::model()->findByPk(Yii::app()->user->id);


        if (isset($_POST['Users'])) {

            $model->attributes = $_POST['Users'];
            $success = $model->save();
        }
        $model->password = '';
       $this->render('updatePassword', array(
           'model' => $model,
           'success'=>$success
       ));
    }
}